﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GameSchool.Models
{
    public class GameRepository
    {
        GameDBContextDataContext db = new GameDBContextDataContext();
        public IEnumerable<Game> Games()
        {
            return db.Games;
        }

        public void Save()
        {
            db.SubmitChanges();
        }

        public void Add(Game newGame)
        {
            db.Games.InsertOnSubmit(newGame);
        }
        
        public void Delete(Game deleteGame)
        {
            db.Games.DeleteOnSubmit(deleteGame);
        }
    }
}